home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / BOOPSI / led_ic / include / intuition / gadgetclass.i < prev   
Encoding:
Text File  |  1999-10-27  |  14.6 KB  |  459 lines

  1.     IFND INTUITION_GADGETCLASS_I
  2. INTUITION_GADGETCLASS_I SET 1
  3.  
  4. **
  5. ** $Id: gadgetclass.i,v 40.0 94/02/15 18:04:33 davidj Exp Locker: davidj $
  6. **
  7. ** Custom and 'boopsi' gadget class interface
  8. **
  9. **  (C) Copyright 1989-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13. ;*****************************************************************************
  14.  
  15.     IFND EXEC_TYPES_I
  16.     INCLUDE "exec/types.i"
  17.     ENDC
  18.  
  19.     IFND INTUITION_INTUITION_I
  20.     INCLUDE "intuition/intuition.i"
  21.     ENDC
  22.  
  23.     IFND UTILITY_TAGITEM_I
  24.     INCLUDE "utility/tagitem.i"
  25.     ENDC
  26.  
  27. ;*****************************************************************************
  28. *
  29. * NOTE:  intuition/iobsolete.i is included at the END of this file!
  30. *
  31. ;*****************************************************************************
  32.  
  33. ; Gadget Class attributes
  34. GA_Dummy         equ    (TAG_USER+$30000)
  35.  
  36. GA_Left            equ    (GA_Dummy+1)
  37.      * (LONG) Left edge of the gadget relative to the left edge of
  38.      * the window
  39.  
  40. GA_RelRight        equ    (GA_Dummy+2)
  41.      * (LONG) Left edge of the gadget relative to the right edge of
  42.      * the window
  43.  
  44. GA_Top            equ    (GA_Dummy+3)
  45.      * (LONG) Top edge of the gadget relative to the top edge of
  46.      * the window
  47.  
  48. GA_RelBottom        equ    (GA_Dummy+4)
  49.      * (LONG) Top edge of the gadget relative to the bottom edge
  50.      * of the window
  51.  
  52. GA_Width        equ    (GA_Dummy+5)
  53.      * (LONG) Width of the gadget
  54.  
  55. GA_RelWidth        equ    (GA_Dummy+6)
  56.      * (LONG) Width of the gadget relative to the width of the
  57.      * window
  58.  
  59. GA_Height        equ    (GA_Dummy+7)
  60.      * (LONG) Height of the gadget
  61.  
  62. GA_RelHeight        equ    (GA_Dummy+8)
  63.      * (LONG) Height of the gadget relative to the height of
  64.      * the window
  65.  
  66. GA_Text            equ    (GA_Dummy+9)
  67.      * (STRPTR) Gadget imagry is NULL terminated string
  68.  
  69. GA_Image        equ    (GA_Dummy+10)
  70.      * (struct Image *) Gadget imagry is an image
  71.  
  72. GA_Border        equ    (GA_Dummy+11)
  73.      * (struct Border *) Gadget imagry is a border
  74.  
  75. GA_SelectRender        equ    (GA_Dummy+12)
  76.      * (struct Image *) Selected gadget imagry
  77.  
  78. GA_Highlight        equ    (GA_Dummy+13)
  79.      * (UWORD) One of GFLG_GADGHNONE, GFLG_GADGHBOX, GFLG_GADGHCOMP,
  80.      * or GFLG_GADGHIMAGE
  81.  
  82. GA_Disabled        equ    (GA_Dummy+14)
  83.      * (BOOL) Indicate whether gadget is disabled or not.
  84.      * Defaults to FALSE.
  85.  
  86. GA_GZZGadget        equ    (GA_Dummy+15)
  87.      * (BOOL) Indicate whether the gadget is for
  88.      * WFLG_GIMMEZEROZERO window borders or not.  Defaults
  89.      * to FALSE.
  90.  
  91. GA_ID            equ    (GA_Dummy+16)
  92.      * (UWORD) Gadget ID assigned by the application
  93.  
  94. GA_UserData        equ    (GA_Dummy+17)
  95.      * (APTR) Application specific data
  96.  
  97. GA_SpecialInfo        equ    (GA_Dummy+18)
  98.      * (APTR) Gadget specific data
  99.  
  100. GA_Selected        equ    (GA_Dummy+19)
  101.      * (BOOL) Indicate whether the gadget is selected or not.
  102.      * Defaults to FALSE
  103.  
  104. GA_EndGadget        equ    (GA_Dummy+20)
  105.      * (BOOL) When set tells the system that when this gadget
  106.      * is selected causes the requester that it is in to be
  107.      * ended.  Defaults to FALSE.
  108.  
  109. GA_Immediate        equ    (GA_Dummy+21)
  110.      * (BOOL) When set indicates that the gadget is to
  111.      * notify the application when it becomes active.  Defaults
  112.      * to FALSE.
  113.  
  114. GA_RelVerify        equ    (GA_Dummy+22)
  115.      * (BOOL) When set indicates that the application wants to
  116.      * verify that the pointer was still over the gadget when
  117.      * the select button is released.  Defaults to FALSE.
  118.  
  119. GA_FollowMouse        equ    (GA_Dummy+23)
  120.      * (BOOL) When set indicates that the application wants to
  121.      * be notified of mouse movements while the gadget is active.
  122.      * It is recommmended that GA_Immediate and GA_RelVerify are
  123.      * also used so that the active gadget can be tracked by the
  124.      * application.  Defaults to FALSE.
  125.  
  126. GA_RightBorder        equ    (GA_Dummy+24)
  127.      * (BOOL) Indicate whether the gadget is in the right border
  128.      * or not.  Defaults to FALSE.
  129.  
  130. GA_LeftBorder        equ    (GA_Dummy+25)
  131.      * (BOOL) Indicate whether the gadget is in the left border
  132.      * or not.  Defaults to FALSE.
  133.  
  134. GA_TopBorder        equ    (GA_Dummy+26)
  135.      * (BOOL) Indicate whether the gadget is in the top border
  136.      * or not.  Defaults to FALSE.
  137.  
  138. GA_BottomBorder        equ    (GA_Dummy+27)
  139.      * (BOOL) Indicate whether the gadget is in the bottom border
  140.      * or not.  Defaults to FALSE.
  141.  
  142. GA_ToggleSelect        equ    (GA_Dummy+28)
  143.      * (BOOL) Indicate whether the gadget is toggle-selected
  144.      * or not.  Defaults to FALSE.
  145.  
  146. GA_SysGadget        equ    (GA_Dummy+29)
  147.      * (BOOL) Reserved for system use to indicate that the
  148.      * gadget belongs to the system.  Defaults to FALSE.
  149.  
  150. GA_SysGType        equ    (GA_Dummy+30)
  151.      * (UWORD) Reserved for system use to indicate the
  152.      * gadget type.
  153.  
  154. GA_Previous        equ    (GA_Dummy+31)
  155.      * (struct Gadget *) Previous gadget in the linked list.
  156.      * NOTE: This attribute CANNOT be used to link new gadgets
  157.      * into the gadget list of an open window or requester.
  158.      * You must use AddGList().
  159.  
  160. GA_Next            equ    (GA_Dummy+32)
  161.      * (struct Gadget *) Next gadget in the linked list.
  162.  
  163. GA_DrawInfo        equ    (GA_Dummy+33)
  164.      * (struct DrawInfo *) Some gadgets need a DrawInfo at creation time
  165.  
  166.  * You should use at most ONE of GA_Text, GA_IntuiText, and GA_LabelImage
  167. GA_IntuiText        equ    (GA_Dummy+34)
  168.      * (struct IntuiText *) Label is an IntuiText.
  169.  
  170. GA_LabelImage        equ    (GA_Dummy+35)
  171.      * (Object *) Label is an image object.
  172.  
  173. GA_TabCycle        equ    (GA_Dummy+36)
  174.      * (BOOL) Indicate whether gadget is part of TAB/SHIFT-TAB cycle
  175.      * activation.  Defaults to FALSE.  New for V37.
  176.  
  177. GA_GadgetHelp        equ    (GA_Dummy+37)
  178.      * (BOOL) Indicate whether gadget is to send IDCMP_GADGETHELP.
  179.      * Defaults to FALSE.  New for V39.
  180.  
  181. GA_Bounds        equ    (GA_Dummy+38)
  182.      * (struct IBox *) Copied into the extended gadget's bounds.
  183.      * New for V39.
  184.  
  185. GA_RelSpecial        equ    (GA_Dummy+39)
  186.      * (BOOL) Indicate whether gadget has special relativity.  Defaults to
  187.      * FALSE.  New for V39.
  188.  
  189. GA_TextAttr        equ    (GA_Dummy+40)
  190.      * (struct TextAttr *) Indicate the font to use for the gadget.
  191.      * New for V42.
  192.  
  193. GA_ReadOnly        equ    (GA_Dummy+41)
  194.      * (BOOL) Indicate that the gadget is read-only (non-selectable).
  195.      * Defaults to FALSE. New for V42.
  196.  
  197. ;*****************************************************************************
  198.  
  199. * PROPGCLASS attributes
  200.  
  201. PGA_Dummy        EQU    (TAG_USER+$31000)
  202. PGA_Freedom        EQU    (PGA_Dummy+$0001)
  203. * either or both of FREEVERT and FREEHORIZ
  204. PGA_Borderless        EQU    (PGA_Dummy+$0002)
  205. PGA_HorizPot        EQU    (PGA_Dummy+$0003)
  206. PGA_HorizBody        EQU    (PGA_Dummy+$0004)
  207. PGA_VertPot        EQU    (PGA_Dummy+$0005)
  208. PGA_VertBody        EQU    (PGA_Dummy+$0006)
  209. PGA_Total        EQU    (PGA_Dummy+$0007)
  210. PGA_Visible        EQU    (PGA_Dummy+$0008)
  211. PGA_Top            EQU    (PGA_Dummy+$0009)
  212. ; New for V37:
  213. PGA_NewLook        EQU    (PGA_Dummy+$000A)
  214.  
  215. ;*****************************************************************************
  216.  
  217. * STRGCLASS attributes
  218.  
  219. STRINGA_Dummy          EQU    (TAG_USER+$32000)
  220. STRINGA_MaxChars    EQU    (STRINGA_Dummy+$0001)
  221. * Note:  There is a minor problem with Intuition when using boopsi integer
  222. * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  223. * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  224. * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  225. * FreeMem() to occur.
  226.  
  227. STRINGA_Buffer        EQU    (STRINGA_Dummy+$0002)
  228. STRINGA_UndoBuffer    EQU    (STRINGA_Dummy+$0003)
  229. STRINGA_WorkBuffer    EQU    (STRINGA_Dummy+$0004)
  230. STRINGA_BufferPos    EQU    (STRINGA_Dummy+$0005)
  231. STRINGA_DispPos        EQU    (STRINGA_Dummy+$0006)
  232. STRINGA_AltKeyMap    EQU    (STRINGA_Dummy+$0007)
  233. STRINGA_Font        EQU    (STRINGA_Dummy+$0008)
  234. STRINGA_Pens        EQU    (STRINGA_Dummy+$0009)
  235. STRINGA_ActivePens    EQU    (STRINGA_Dummy+$000A)
  236. STRINGA_EditHook    EQU    (STRINGA_Dummy+$000B)
  237. STRINGA_EditModes    EQU    (STRINGA_Dummy+$000C)
  238.  
  239. * booleans
  240. STRINGA_ReplaceMode    EQU    (STRINGA_Dummy+$000D)
  241. STRINGA_FixedFieldMode    EQU    (STRINGA_Dummy+$000E)
  242. STRINGA_NoFilterMode    EQU    (STRINGA_Dummy+$000F)
  243.  
  244. STRINGA_Justification    EQU    (STRINGA_Dummy+$0010)
  245. * GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT
  246. STRINGA_LongVal        EQU    (STRINGA_Dummy+$0011)
  247. STRINGA_TextVal        EQU    (STRINGA_Dummy+$0012)
  248.  
  249. STRINGA_ExitHelp    EQU    (STRINGA_Dummy+$0013)
  250. * STRINGA_ExitHelp is new for V37, and ignored by V36.
  251. * Set this if you want the gadget to exit when Help is
  252. * pressed.  Look for a code of 0x5F, the rawkey code for Help
  253.  
  254. SG_DEFAULTMAXCHARS    EQU    (128)
  255.  
  256. ;*****************************************************************************
  257.  
  258. * Gadget Layout related attributes
  259.  
  260. LAYOUTA_Dummy         EQU    (TAG_USER+$38000)
  261. LAYOUTA_LayoutObj    EQU    (LAYOUTA_Dummy+$0001)
  262. LAYOUTA_Spacing        EQU    (LAYOUTA_Dummy+$0002)
  263. LAYOUTA_Orientation    EQU    (LAYOUTA_Dummy+$0003)
  264.  
  265. LAYOUTA_ChildMaxWidth    equ    (LAYOUTA_Dummy+$0004)
  266.      * (BOOL) Child objects are of equal width.  Should default to TRUE for
  267.      * gadgets with a horizontal orientation.  New for V42.
  268. LAYOUTA_ChildMaxHeight    equ    (LAYOUTA_Dummy+$0005)
  269.      * (BOOL) Child objects are of equal height.  Should default to TRUE for
  270.      * gadgets with a vertical orientation.  New for V42.
  271.  
  272. * orientation values
  273. LORIENT_NONE        EQU    0
  274. LORIENT_HORIZ        EQU    1
  275. LORIENT_VERT        EQU    2
  276.  
  277. ;*****************************************************************************
  278.  
  279. ; Custom gadget hook command ID's
  280. ; (gadget class method/message ID's)
  281.  
  282. GM_HITTEST EQU        0    ; return GMR_GADGETHIT if you are clicked
  283.                 ; (whether or not you are disabled)
  284. GM_RENDER EQU        1    ; draw yourself, in the appropriate state
  285. GM_GOACTIVE EQU        2    ; you are now going to be fed input
  286. GM_HANDLEINPUT EQU    3    ; handle that input
  287. GM_GOINACTIVE EQU    4    ; whether or not by choice, you are done
  288. GM_HELPTEST EQU        5    ; Will you send gadget help if the mouse is
  289.                 ; at the specified coordinates?  See below
  290.                 ; for possible GMR_ values.
  291. GM_LAYOUT EQU        6    ; re-evaluate your size based on the GadgetInfo
  292.                 ; Domain.  Do NOT re-render yourself yet, you
  293.                 ; will be called when it is time...
  294.  
  295. ;*****************************************************************************
  296.  
  297. ; Parameter "Messages" passed to gadget class methods
  298.  
  299. ; All parameter structure begin with a MethodID field
  300. ; This definition of an abstract generic "message" is
  301. ; equivalent to a better one in intuition/classusr.i, but
  302. ; it's left here for historic reasons
  303.  STRUCTURE MsgHeader,0
  304.     ULONG    MethodID
  305.     LABEL    methodid_SIZEOF
  306.  
  307. ; GM_HITTEST and GM_HELPTEST send this message.
  308. ; For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
  309. ; select box.  For GM_HELPTEST, the coordinates are relative to
  310. ; the gadget bounding box (which defaults to the select box).
  311.  STRUCTURE    gpHitTest,methodid_SIZEOF
  312.     APTR    gpht_GInfo
  313.     WORD    gpht_MouseX
  314.     WORD    gpht_MouseY
  315.  
  316. ; For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  317. ; otherwise return zero.
  318. ;
  319. ; For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  320. ; Typically, return GMR_HELPHIT if you were hit.
  321. ; It is possible to pass a UWORD to the application via the Code field
  322. ; of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  323. ; the UWORD-sized result you wish to return.
  324. ;
  325. ; GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  326. ; mean "nothing particular" to the application.
  327.  
  328. GMR_GADGETHIT    EQU $00000004    ; GM_HITTEST hit
  329.  
  330. GMR_NOHELPHIT    EQU $00000000    ; GM_HELPTEST didn't hit
  331. GMR_HELPHIT    EQU $FFFFFFFF    ; GM_HELPTEST hit, return code = ~0
  332. GMR_HELPCODE    EQU $00010000    ; GM_HELPTEST hit, return low word as code
  333.  
  334. ;*****************************************************************************
  335.  
  336. ; GM_RENDER
  337.  STRUCTURE    gpRender,methodid_SIZEOF
  338.     APTR    gpr_GInfo    ; gadget context
  339.     APTR    gpr_RPort    ; all ready for use
  340.     LONG    gpr_Redraw    ; might be a "highlight pass"
  341.  
  342. ; values of gpr_Redraw
  343. GREDRAW_UPDATE    EQU 2    ; update for change in attributesvalues
  344. GREDRAW_REDRAW    EQU 1    ; redraw gadget
  345. GREDRAW_TOGGLE    EQU 0    ; toggle highlight, if applicable
  346.  
  347. ;*****************************************************************************
  348.  
  349. ; GM_GOACTIVE, GM_HANDLEINPUT
  350.  STRUCTURE    gpInput,methodid_SIZEOF
  351.     APTR    gpi_GInfo
  352.     APTR    gpi_IEvent
  353.     APTR    gpi_Termination
  354.     WORD    gpi_MouseX
  355.     WORD    gpi_MouseY
  356.  
  357.     ; (V39) Pointer to TabletData structure, if this event originated
  358.     ; from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  359.     ; not.
  360.     ;
  361.     ; DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  362.     ; IT WILL BE INVALID!
  363.     APTR    gpi_TabletData
  364.  
  365. ; GM_HANDLEINPUT and GM_GOACTIVE  return code flags
  366. ; return GMR_MEACTIVE (0) alone if you want more input.
  367. ; Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  368. ; GMR_VERIFY.
  369.  
  370. ; here are the original constant "equates"
  371. GMR_MEACTIVE    EQU $0000     ; (bugfix: was $0001 during beta)
  372. GMR_NOREUSE    EQU $0002
  373. GMR_REUSE    EQU $0004
  374. GMR_VERIFY    EQU $0008    ; you MUST set gpi_Termination
  375.  
  376. * New for V37:
  377. * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  378. * which instructs Intuition to activate the next or previous gadget
  379. * that has GFLG_TABCYCLE set.
  380. *
  381. GMR_NEXTACTIVE    EQU $0010
  382. GMR_PREVACTIVE    EQU $0020
  383.  
  384. ; here are standard bit/flag pairs
  385. GMRB_NOREUSE    EQU 1
  386. GMRB_REUSE    EQU 2
  387. GMRB_VERIFY    EQU 3
  388. GMRB_NEXTACTIVE    EQU 4
  389. GMRB_PREVACTIVE    EQU 5
  390.  
  391. GMRF_NOREUSE    EQU $0002
  392. GMRF_REUSE    EQU $0004
  393. GMRF_VERIFY    EQU $0008
  394. GMRF_NEXTACTIVE    EQU $0010
  395. GMRF_PREVACTIVE    EQU $0020
  396.  
  397. ;*****************************************************************************
  398.  
  399. ; GM_GOINACTIVE
  400.  STRUCTURE    gpGoInactive,methodid_SIZEOF
  401.     APTR    gpgi_GInfo
  402.  
  403. * V37 field only!  DO NOT attempt to read under V36!
  404.     ULONG    gpgi_Abort    ; gpgi_Abort=1 if gadget was aborted
  405.                 ; by Intuition and 0 if gadget went
  406.                 ; inactive at its own request
  407.  
  408. ;*****************************************************************************
  409.  
  410. * New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  411. * the gadget is added to the window (or when the window opens, if
  412. * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  413. * list), or when the window is resized.  Your gadget can set the
  414. * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  415. * changing the interpretation of your gadget select box.  This
  416. * allows for completely arbitrary resizing/repositioning based on
  417. * window size.
  418.  
  419. ; GM_LAYOUT
  420.  STRUCTURE    gpLayout,methodid_SIZEOF
  421.     APTR    gpl_GInfo
  422.     APTR    gpl_Initial    ; non-zero if this method was invoked
  423.                 ; during AddGList() or OpenWindow()
  424.                 ; time.  zero if this method was invoked
  425.                 ; during window resizing.
  426.  
  427. ;*****************************************************************************
  428.  
  429. ; The GM_DOMAIN method is used to obtain the sizing requirements of an
  430. ; object for a class before ever creating an object.
  431.  
  432. ; GM_DOMAIN
  433.  STRUCTURE     gpDomain,methodid_SIZEOF
  434.     APTR     gpd_GInfo
  435.     APTR     gpd_RPort        ; RastPort to layout for
  436.     LONG     gpd_Which
  437.     STRUCT     gpd_Domain,ibox_SIZEOF    ; Result domain
  438.     APTR     gpd_Attrs        ; Additional attributes
  439.  
  440. GDOMAIN_MINIMUM        equ    0
  441.     ; Minimum size
  442.  
  443. GDOMAIN_NOMINAL        equ    1
  444.     ; Nominal size
  445.  
  446. GDOMAIN_MAXIMUM        equ    2
  447.     ; Maximum size
  448.  
  449. ;*****************************************************************************
  450.  
  451. * Include obsolete identifiers:
  452.     IFND    INTUITION_IOBSOLETE_I
  453.     INCLUDE "intuition/iobsolete.i"
  454.     ENDC
  455.  
  456. ;*****************************************************************************
  457.  
  458.     ENDC
  459.